local Entity = require("gameLogic.fight.fightEntity.Entity")
local CallEntity = class("CallEntity", Entity)

-- 召唤物
function CallEntity:ctor(excuter, normalSkillCfg, id, element)
    CallEntity.super.ctor(self, excuter, normalSkillCfg, id, element)
    self._continuance = 0
    self:setDebugName("召唤物" .. self._id)
end

function CallEntity:setContinuance(continuece)
    self._continuance = continuece
end

function CallEntity:check(report)
    self._continuance = self._continuance - 1
    if self._continuance <= 0 then
        self:setDie(true)
        report:addEntityDie(self)
    end
end

function CallEntity:setDie(die)
    self._isDie = die
    if self._isDie then
        local buffManager = self:getExcuter():getBuffManager()
        buffManager:removeBuffByEntity(self)
        self:getExcuter():removeCallEntity(self:getId())
        self._stand.use = false
        printDebug(self:getDebugName() .. " 死亡")
    end
end

function CallEntity:setStanding(stand)
    stand.use = true
    self._stand = stand
end

return CallEntity
